package threaduse;

/**
 * @description:
 * @Author yyp
 * @time 2022/3/29
 */
public class ThreadMethod02 {
    public static void main(String[] args) throws InterruptedException {
        T t1 = new T();
        t1.start();
        t1.join();
        for (int i = 0; i < 10; i++) {
            Thread.sleep(500);
            System.out.println("yyp"+i);
        }
    }
}

class T extends Thread{
    @Override
    public void run(){
        for (int i = 0; i < 10; i++) {
            try{
                Thread.sleep(200);
            }catch (InterruptedException e){
                e.printStackTrace();
            }
            System.out.println("joinThread--"+i);
        }
    }
}
